<html>
<head><meta charset="utf-8"><title>map from canonical · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html">map from canonical</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200109815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200109815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200109815">(Jun 08 2020 at 15:00)</a>:</h4>
<p>There is an inconsistency in <code>u_canonicalize</code>/<code>map_from_canonical</code>/<code>apply_answer_subst</code>, but since I don't know the intended design that well, I would like someone else to confirm my suspicions. <br>
1) <code>u_canonicalize</code> does not add canonical binders to <code>UniverseMap</code>, which is intended, as I understand, because we don't care much about inference var universes between placeholder universes</p>



<a name="200110328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200110328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200110328">(Jun 08 2020 at 15:03)</a>:</h4>
<p>2) <code>map_from_canonical</code> does not map inference var universes back to the original universes, which is a little weird and I don't know if it's intended</p>



<a name="200110518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200110518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200110518">(Jun 08 2020 at 15:04)</a>:</h4>
<p>By that I mean that if I pass <code>Canonical&lt;T&gt;</code> to <code>map_from_canonical</code>, then binders won't be affected</p>



<a name="200110956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200110956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200110956">(Jun 08 2020 at 15:07)</a>:</h4>
<p>3) <code>apply_answer_subst</code> takes that remapped canonical value, whose binders' universes are still in canonicalized form, and instantiates them? I don't understand why that is the way it is</p>



<a name="200112263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200112263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200112263">(Jun 08 2020 at 15:16)</a>:</h4>
<p>What I think was intended: canonical binders should be remapped back to their original universes before instantiating, but I don't know how correct is that, because we didn't save those universes to the <code>UniverseMap</code> in <code>u_canonicalize</code>, we only saved the placeholder variables universes.</p>



<a name="200113754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200113754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200113754">(Jun 08 2020 at 15:26)</a>:</h4>
<p>/me mutters an incantation to summon <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="200158936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200158936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200158936">(Jun 08 2020 at 21:34)</a>:</h4>
<p>hmm</p>



<a name="200159021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159021">(Jun 08 2020 at 21:35)</a>:</h4>
<p>certainly the intent was to map universes "from" the more complex ones "down" to a compressed space and then back again</p>



<a name="200159044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159044">(Jun 08 2020 at 21:35)</a>:</h4>
<p>I remember there being, as an aside, a bug that had to do with the root universe</p>



<a name="200159049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159049">(Jun 08 2020 at 21:35)</a>:</h4>
<p>which I don't think was fixd</p>



<a name="200159064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159064">(Jun 08 2020 at 21:35)</a>:</h4>
<p>i.e., we have to always consider the root universe "used"</p>



<a name="200159075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159075">(Jun 08 2020 at 21:35)</a>:</h4>
<p>I don't think the distinct treatment between inference variables and placeholders  was intended</p>



<a name="200159108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159108">(Jun 08 2020 at 21:35)</a>:</h4>
<p>however, as an aside, I think it probably <em>also</em> makes sense for us to introduce "binders" for the placeholders in the canonical form</p>



<a name="200159148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159148">(Jun 08 2020 at 21:36)</a>:</h4>
<p>rustc at least does this -- I sort of forget why :)</p>



<a name="200159176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159176">(Jun 08 2020 at 21:36)</a>:</h4>
<p>but I'm wondering if it would make it easier to factor things cleanly here in some way</p>



<a name="200159215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159215">(Jun 08 2020 at 21:37)</a>:</h4>
<p>It was intended, <code>UniverseMap::map_universe_to_canonical</code> talks about it</p>



<a name="200159237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159237">(Jun 08 2020 at 21:37)</a>:</h4>
<p>hmm</p>



<a name="200159242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159242">(Jun 08 2020 at 21:37)</a>:</h4>
<p>I guess i'll have to review the code</p>



<a name="200159269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159269">(Jun 08 2020 at 21:37)</a>:</h4>
<p>Im wondering how it worked for so long</p>



<a name="200159328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159328">(Jun 08 2020 at 21:38)</a>:</h4>
<p>Guess we just don't have enough universes in tests</p>



<a name="200159520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200159520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200159520">(Jun 08 2020 at 21:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/map.20from.20canonical/near/200159064">said</a>:</p>
<blockquote>
<p>i.e., we have to always consider the root universe "used"</p>
</blockquote>
<p>what does that mean? that nothing should exist in the root universe?</p>



<a name="200160399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200160399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200160399">(Jun 08 2020 at 21:50)</a>:</h4>
<p>that we never want to map a placeholder into the root universe</p>



<a name="200160541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200160541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200160541">(Jun 08 2020 at 21:51)</a>:</h4>
<p>we map canonical binders to <code>U0</code>, if there are no placeholders anywhere in the input</p>



<a name="200476578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200476578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200476578">(Jun 10 2020 at 21:06)</a>:</h4>
<p><span class="user-mention" data-user-id="251766">@Areredify</span> I'm reviewing the code here :)</p>



<a name="200477313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477313">(Jun 10 2020 at 21:10)</a>:</h4>
<p>OK, I now follow your point, and I agree that the code as written is kind of fundamentally broken</p>



<a name="200477349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477349">(Jun 10 2020 at 21:11)</a>:</h4>
<p>Definitely <em>feels</em> like a "how did this ever work" situation ;)</p>



<a name="200477392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477392">(Jun 10 2020 at 21:11)</a>:</h4>
<p>Yeah I was really surprised</p>



<a name="200477475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477475">(Jun 10 2020 at 21:12)</a>:</h4>
<p>Thought I didn't understand something about how it was supposed to work</p>



<a name="200477577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477577">(Jun 10 2020 at 21:13)</a>:</h4>
<p>I suppose that a "more interesting" question is "how should it work"</p>



<a name="200477585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477585">(Jun 10 2020 at 21:13)</a>:</h4>
<p>feels like an opportunity to rethink a bit this setup</p>



<a name="200477699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477699">(Jun 10 2020 at 21:14)</a>:</h4>
<p>but apart from making any bigger changes, it seems like the thing to do would be to modify <code>map_from_canonical</code> so that it takes a <code>Canonical&lt;T&gt;</code> and a universe map, and it returns a <code>Canonical&lt;T::Result&gt;</code> where the universes in those binders have been remapped</p>



<a name="200477838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477838">(Jun 10 2020 at 21:15)</a>:</h4>
<p>I had a question about that</p>



<a name="200477908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200477908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200477908">(Jun 10 2020 at 21:15)</a>:</h4>
<p>Does it matter that we lose information because we don't add binders to universe map when ucanonicalizing?</p>



<a name="200478157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478157">(Jun 10 2020 at 21:17)</a>:</h4>
<p>And consequently, does it matter that <code>map_from_canonical</code> maps to universe approximations for inference vars</p>



<a name="200478174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478174">(Jun 10 2020 at 21:17)</a>:</h4>
<p>I was pondering that</p>



<a name="200478186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478186">(Jun 10 2020 at 21:18)</a>:</h4>
<p>I seemed to feel it did not</p>



<a name="200478230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478230">(Jun 10 2020 at 21:18)</a>:</h4>
<p>but I'm not 100% sure that is correct</p>



<a name="200478249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478249">(Jun 10 2020 at 21:18)</a>:</h4>
<p>that said</p>



<a name="200478279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478279">(Jun 10 2020 at 21:18)</a>:</h4>
<p>I'm also wondering whether there can be universes in the output that weren't preset in the input anyway, seems likely</p>



<a name="200478330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478330">(Jun 10 2020 at 21:19)</a>:</h4>
<p>let me try to craft an example and see if I'm confusing myself</p>



<a name="200478651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478651">(Jun 10 2020 at 21:22)</a>:</h4>
<p>Query:</p>
<div class="codehilite"><pre><span></span><code>canonical&lt;X&gt; {
    forall&lt;T&gt; { T: Trait&lt;X&gt; }
}
</code></pre></div>


<p>with a program clause like</p>
<div class="codehilite"><pre><span></span><code>forall&lt;T, Y&gt; { T: Trait&lt;Y&gt; }
</code></pre></div>


<p>would generate a result like</p>
<div class="codehilite"><pre><span></span><code>canonical&lt;Y&gt; {
  X = Y
}
</code></pre></div>


<p>where this <code>Y</code> is in some fresh universe created during the processing -- ah, but of course, to be instantiated, it had to be equated with the variable for <code>X</code>, which was created in some input univese. So yeah I think I'm confusing myself. I think the only case this can occur is with the <code>forall</code> in region constraints (which is a separate thing).</p>



<a name="200478700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478700">(Jun 10 2020 at 21:22)</a>:</h4>
<p>so it seems like maybe it <em>does</em> matter to me though</p>



<a name="200478712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478712">(Jun 10 2020 at 21:22)</a>:</h4>
<p>let me try to craft an example</p>



<a name="200478954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200478954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200478954">(Jun 10 2020 at 21:25)</a>:</h4>
<p><code>canonical</code> is <code>exists</code>?</p>



<a name="200479001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479001">(Jun 10 2020 at 21:25)</a>:</h4>
<p>yeah, I just meant an exists bound in a canonical specifically</p>



<a name="200479083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479083">(Jun 10 2020 at 21:26)</a>:</h4>
<p>gotcha</p>



<a name="200479658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479658">(Jun 10 2020 at 21:31)</a>:</h4>
<p>OK so I think that given an example like this</p>
<div class="codehilite"><pre><span></span><code>forall&lt;A&gt; {
    forall&lt;B&gt; {
        exists&lt;E&gt; {
            A: ForAny&lt;E&gt;,
            E = B,
        }
    }
}
</code></pre></div>


<p>where we have the clause</p>
<div class="codehilite"><pre><span></span><code>forall&lt;X, Y&gt; { X: ForAny&lt;Y&gt; }
</code></pre></div>


<p>we could have a problem. What would go wrong is this:</p>
<ul>
<li>We create a placeholder <code>!U1</code> for <code>A</code> (in universe 1)</li>
<li>We create a placeholder <code>!U2</code> for <code>B</code> (in universe 2)</li>
<li>We create the existential variable <code>E</code> in universe 2.</li>
<li>To process <code>A: ForAny&lt;E&gt;</code>, we map to <code>canonical&lt;E:U1&gt; { !U1: ForAny&lt;E&gt; }</code>. Here, we have mapped <code>E</code> to <code>U1</code> because that was the only relevant thing.</li>
<li>The result is that this goal is true for any <code>E</code> -- so we're going to get back a result like <code>canonical&lt;X:U1&gt; { E = X }</code>. But when we instantiate (and remap) that universe back to the origin, we'll end up unifying <code>E</code> with some fresh <code>X</code> in U1, so the universe of <code>E</code> will change from <code>U2</code> to <code>U1</code>.</li>
<li>then when we try to solve <code>E = !U2</code>, we get an error.</li>
</ul>



<a name="200479722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479722">(Jun 10 2020 at 21:32)</a>:</h4>
<p>So I think that the <em>correct</em> thing to do is to preserve <em>all</em> the universes just as they are given, so we can remap back exactly.</p>



<a name="200479816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479816">(Jun 10 2020 at 21:33)</a>:</h4>
<p>And I think the flaw in my reasoning is that I said this</p>
<div class="codehilite"><pre><span></span><code>/// Moreover, since there are no placeholders from U2 in
    /// the original query, there is no way we would have equated `?0`
    /// with such a name.
</code></pre></div>


<p>but I wasn't taking into account that sometimes the result is an unconstrained inference variable.</p>



<a name="200479857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479857">(Jun 10 2020 at 21:33)</a>:</h4>
<p>i.e., we may not name a <em>placeholder</em> from that universe, but we might name an existential variable</p>



<a name="200479876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479876">(Jun 10 2020 at 21:33)</a>:</h4>
<p>Does that sound right to you?</p>



<a name="200479902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200479902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200479902">(Jun 10 2020 at 21:33)</a>:</h4>
<p>Yes, makes sense</p>



<a name="200480023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480023">(Jun 10 2020 at 21:34)</a>:</h4>
<p>Now some of this comes back to the question that I've raised a time or two about when we can "canonicalize placeholders". I mentioned that rustc does it, though I'm a bit unsure why at this point, I have to go look at this code again. But if we did so, it has the advantage that all of this universe mapping is <em>within the binders of the canonical</em></p>



<a name="200480038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480038">(Jun 10 2020 at 21:34)</a>:</h4>
<p>i.e., we don't have to go and remap things within the canonical value</p>



<a name="200480058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480058">(Jun 10 2020 at 21:35)</a>:</h4>
<p>we just adjust the universes stored in the <code>Canonical</code> meta-data</p>



<a name="200480064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480064">(Jun 10 2020 at 21:35)</a>:</h4>
<p>which is appealing to me</p>



<a name="200480086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480086">(Jun 10 2020 at 21:35)</a>:</h4>
<p>Actually, I think that is precisely the example I got this error on</p>



<a name="200480231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480231">(Jun 10 2020 at 21:36)</a>:</h4>
<p>I had <code>LocalImplAllowed(?0: Foo), AliasEq(&lt;!1_0 as Iterator&gt;::Item, ?0)</code></p>



<a name="200480266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480266">(Jun 10 2020 at 21:36)</a>:</h4>
<p>With <code>?0</code> in U1</p>



<a name="200480275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480275">(Jun 10 2020 at 21:37)</a>:</h4>
<p>ah yeah</p>



<a name="200480287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480287">(Jun 10 2020 at 21:37)</a>:</h4>
<p>that's kind of a simpler way to show it</p>



<a name="200480290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480290">(Jun 10 2020 at 21:37)</a>:</h4>
<p>i.e., no placeholders at all</p>



<a name="200480295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480295">(Jun 10 2020 at 21:37)</a>:</h4>
<p>will always map the <code>?0</code> to <code>U0</code></p>



<a name="200480301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480301">(Jun 10 2020 at 21:37)</a>:</h4>
<p>Proving <code>LocalImplAllowed</code> does not constraint <code>?0</code>, so it was mapped to <code>U0</code></p>



<a name="200480308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200480308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200480308">(Jun 10 2020 at 21:37)</a>:</h4>
<p>Exactly</p>



<a name="200481100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200481100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200481100">(Jun 10 2020 at 21:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/map.20from.20canonical/near/200480058">said</a>:</p>
<blockquote>
<p>we just adjust the universes stored in the <code>Canonical</code> meta-data</p>
</blockquote>
<p>That does sound pretty cool</p>



<a name="200481731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200481731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200481731">(Jun 10 2020 at 21:50)</a>:</h4>
<p>do you want to try and do that refactoring?</p>



<a name="200481746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200481746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200481746">(Jun 10 2020 at 21:50)</a>:</h4>
<p>should we try to make some tests that fail given the existing broken code?</p>



<a name="200481749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200481749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200481749">(Jun 10 2020 at 21:50)</a>:</h4>
<p>seems like a good first step :)</p>



<a name="200481990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200481990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200481990">(Jun 10 2020 at 21:53)</a>:</h4>
<p>Sure, I will go do that (but tomorrow, it's 1 am now)</p>



<a name="200482458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200482458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200482458">(Jun 10 2020 at 21:56)</a>:</h4>
<p>=)</p>



<a name="200482462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200482462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200482462">(Jun 10 2020 at 21:56)</a>:</h4>
<p>OK</p>



<a name="200482469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200482469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200482469">(Jun 10 2020 at 21:56)</a>:</h4>
<p>Let's make an issue for it</p>



<a name="200482654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200482654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200482654">(Jun 10 2020 at 21:58)</a>:</h4>
<p>filed <a href="https://github.com/rust-lang/chalk/issues/512">https://github.com/rust-lang/chalk/issues/512</a></p>



<a name="200512711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200512711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200512711">(Jun 11 2020 at 07:28)</a>:</h4>
<p>Also, side note: do you think we should add the ability to print universes of inference vars (if there is an inference table in tls)?</p>



<a name="200524194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200524194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200524194">(Jun 11 2020 at 09:53)</a>:</h4>
<p>seems like it would be useful</p>



<a name="200524250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200524250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200524250">(Jun 11 2020 at 09:54)</a>:</h4>
<p>we've not traditionally had the inference table in TLS</p>



<a name="200524269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200524269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200524269">(Jun 11 2020 at 09:54)</a>:</h4>
<p>but if we <em>did</em>, I would probably also want to print the type that an inference variable is unified with (if any)</p>



<a name="200897709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/200897709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Areredify <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#200897709">(Jun 15 2020 at 14:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  Hmm, so I have a question: what to do we do with indices within universes? The easiest way of course is to just leave them be, but that doesn't feel very "canonical"</p>



<a name="201059553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/201059553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#201059553">(Jun 16 2020 at 18:59)</a>:</h4>
<p><span class="user-mention" data-user-id="251766">@Areredify</span> if we move the placeholders into the canonical binder this problem becomes moot</p>



<a name="201059602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/map%20from%20canonical/near/201059602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/map.20from.20canonical.html#201059602">(Jun 16 2020 at 19:00)</a>:</h4>
<p>that's indeed part of the point</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>